<div data-dux="table-bind">
    <div class="dux-page-header uk-clearfix">
        <div class="page-title">
            <form class="dux-form uk-form  uk-form-inline" method="get" action="{url()}">
                <div class="uk-form-group">
                    <input type="text" name="keyword" class="uk-form-field" value="{$pageMaps.keyword}"
                           placeholder="搜索">
                </div>
                <div class="uk-form-group">
                    <select class="uk-form-field" name="status">
                        <option value="3">状态</option>
                        <option value="1" <!--if{$pageMaps.status == 1}-->selected <!--{/if}-->>已下架</option>
                        <option value="2" <!--if{$pageMaps.status == 2}-->selected <!--{/if}-->>已上架</option>
                    </select>
                </div>
                <div class="uk-form-group">
                    <button type="submit" class="uk-button uk-button-primary"><i class="fa fa-search"></i></button>
                </div>
            </form>
        </div>
        <div class="page-action">
            <a class="uk-button uk-button-primary" href="{url('add')}">添加</a>
        </div>
    </div>
    <div class="dux-page-table">
        <table class="uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table" data-table>
            <thead>
            <tr>
                <th width="100">#</th>
                <th width="120">封面</th>
                <th>名称</th>
                <th>面额</th>
                <th>库存</th>
                <th>发放时间</th>
                <th>有效时间(天)</th>
                <th class="uk-text-center" width="250">状态</th>
                <th class="uk-text-center" width="250">管理</th>
            </tr>
            </thead>
            <tbody>
            <!--loop{$list as $vo}-->
            <tr>
                <td>
                    {$vo.coupon_id}
                </td>
                <td>
                    <img src="{$vo.image}" height="80">
                </td>
                <td>
                    <a href="{$vo.url ? $vo.url : ROOT_URL . '/'}" target="_blank">{$vo.name}</a>
                    <p>{$vo.class_name} - {$vo.type=='common' ? '全品': $typeList[$vo.type]['name']}券</p>
                </td>
                <td>
                    满<span class="uk-text-danger">{$vo.meet_money}</span>减<span class="uk-text-danger">{$vo.money}</span>
                </td>
                <td>
                    {$vo.receive} / {$vo.stock}
                </td>
                <td>
                    {$vo.expiry_day}天
                </td>
                <td>
                    <div>{date('Y-m-d H:i:s', $vo.start_time)}</div>
                    <div>{date('Y-m-d H:i:s', $vo.end_time)}</div>
                </td>

                <td class="uk-text-center">
                    <!--if{$vo.status == 0}-->
                    <span class="uk-text-danger">已下架</span>
                    <!--{/if}-->
                    <!--if{$vo.status == 1}-->
                    <span class="uk-text-success">已上架</span>
                    <!--{/if}-->
                </td>

                <td class="uk-text-center">
                    <a class="uk-button uk-button-primary uk-button-small" href="{url('edit', ['id' => $vo.coupon_id])}">编辑</a>
                    <!--if{$vo.status}-->
                    <a class="uk-button uk-button-danger uk-button-small" href="javascript:;" data-dux="dialog-ajaxConfirm"
                       data-url="{url('status', ['id' => $vo.coupon_id, 'status' => 0])}"
                       data-title="确认上架优惠券?">下架</a>
                    <!--{/if}-->
                    <!--if{!$vo.status}-->
                    <a class="uk-button uk-button-primary uk-button-small" href="javascript:;" data-dux="dialog-ajaxConfirm"
                       data-url="{url('status', ['id' => $vo.coupon_id, 'status' => 1])}"
                       data-title="确认上架优惠券?">上架</a>
                    <!--{/if}-->


                    <a class="uk-button uk-button-danger uk-button-small" href="javascript:;"
                       data-url="{url('del')}" data-id="{$vo.coupon_id}" title="删除" data-del>删除</a>
                </td>
            </tr>
            <!--{/loop}-->
            </tbody>
        </table>
    </div>
    <div class="dux-page-foot uk-clearfix">
        {$page}
    </div>
</div>